package org.springboot.sample.entity;

import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;

public class User implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 357171157985225965L;
	/**
	 * 原来是UUID类型，对应postgresql中的uuid，但mybatis的mapper中没有TypeHandler，则改为String
	 */
	private String id;
	private String firstName;
	private String lastName;
	private Date dateUpdated;
	private Date birthDay;
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getFirstName() {
		return firstName;
	}
	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}
	public String getLastName() {
		return lastName;
	}
	public void setLastName(String lastName) {
		this.lastName = lastName;
	}
	//解决Date类型显示为long time问题
	@JsonFormat(pattern="yyyy-MM-dd",timezone="GMT+8")
	public Date getDateUpdated() {
		return dateUpdated;
	}
	public void setDateUpdated(Date dateUpdated) {
		this.dateUpdated = dateUpdated;
	}
	@JsonFormat(pattern="yyyy-MM-dd",timezone="GMT+8")
	public Date getBirthDay() {
		return birthDay;
	}
	public void setBirthDay(Date birthDay) {
		this.birthDay = birthDay;
	}
	public String toString(){
		return id+","+firstName+","+lastName+","+dateUpdated+","+birthDay;
	}
}
